package com.lh.java.basic.beanutil;

import java.lang.reflect.InvocationTargetException;
import java.util.Date;

import org.apache.commons.beanutils.PropertyUtils;
import org.springframework.beans.BeanUtils;

/**
 ************************************************ 
 ** Module : 测试BeanUtil属性的转换 Date: 2012-2-10 Time: 上午11:04:48 Author lh
 ************************************************ 
 */
public class TestBeanUtil {

	public static void main(String[] args) {
		BaseWebsiteAd bw = new BaseWebsiteAd();
		bw.setAd_id(10);
		bw.setId(1);
		bw.setIp_adress("192.168.1.2");
		bw.setRecord_time(new Date());
		WebsiteClickedAd websiteClickedAd = new WebsiteClickedAd();
		BeanUtils.copyProperties(bw, websiteClickedAd);

		System.out.println("id=" + websiteClickedAd.getId());
		System.out.println("ad_id=" + websiteClickedAd.getAd_id());
		System.out.println("ip=" + websiteClickedAd.getIp_adress());
		System.out.println("time=" + websiteClickedAd.getRecord_time());
		System.out.println("recod times=" + websiteClickedAd.getClick_times());

		System.out.println(System.getProperty("os.name")); // win2003竟然是win xp

		System.out.println(System.getProperty("os.version"));

		System.out.println(System.getProperty("os.arch"));

	}

}
